package com.pactera.madp.cp.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.pactera.madp.cp.api.dto.crm.CrmCustomQueryConditionDTO;
import com.pactera.madp.cp.api.entity.crm.WorkCustomInfoEntity;
import com.pactera.madp.cp.api.vo.AddCustomerVO;

import java.util.List;
import java.util.Map;

/**
 * CRM客户数据业务服务
 */
public interface WorkCustomInfoService extends IService<WorkCustomInfoEntity> {

    /**
     * 查询全部
     * @return
     */
    List<WorkCustomInfoEntity> listAll();

    /**
     * 删除分表全部数据
     * @return
     */
    boolean removeAll();

    /**
     * 批量分表保存
     * @return
     */
    boolean batchSaveAll(List<WorkCustomInfoEntity> entityList);

    /**
     * 根据条件查询
     * @return
     */
    List<WorkCustomInfoEntity> listByCondition(CrmCustomQueryConditionDTO dto);

    Integer countInCustMgrNoAndMobile(List<String> custMgrNos,List<String> mobiles);

    Integer countInOrgCodes(List<String> orgCodes);

    Integer countInOrgCodesAndMgrNos(List<String> orgCodes, List<String> wxUserIds);

    Integer countInMobiles(List<String> mobiles);

    List<Map<String,String>> getCustNameAndAssetsLevelByMobile(String mobile);

    List<Map<String,String>> getCustNameAndAssetsLevelByMobiles(List<String> mobiles);

    Page<AddCustomerVO> getAddCustomerVOPage(Page page,String state,List<String> wxUserIds);

    List<AddCustomerVO> addCustomerVOList(String state, List<String> wxUserIds, Integer tableSort, Long limitStart, Long size);

    List<AddCustomerVO> getAddCustomerVOListByCustMgrNo(String custMgrNo,List<String> wxUserIds);

    List<Map<String, Long>> count(String state, List<String> wxUserIds);

}
